{# 继承 layout 模板 #}
{% extends '../layout.njk' %}

{# 标题 #}
{% block title %}
学生选课
{% endblock%}

{# CSS #}
{% block cssLinks %}
{{ super() }}
{% endblock %}

{# 页面内容 #}
{% block content %}
<h3 class="title">学生选课</h3>
<div>
    欢迎 {{ student.name }} 。
    <a href="/student/sign/out">退出</a>
</div>
<div class="container">
    <div>{{ tip.message }}</div>
    <form action="/student/choose" method="post">
        <div>
            请选择课程:
            {% for c in courses %}
                {% if c.checked %}
                <input type="checkbox" name="course" value="{{ c.id }}" id="{{ c.id }}" checked>
                {% else %}
                <input type="checkbox" name="course" value="{{ c.id }}" id="{{ c.id }}">
                {% endif %}
                <label for="{{ c.id }}">{{ c.name }}</label>
            {% endfor %}
        </div>
        <button>确定</button>
    </form>
</div>
{% endblock %}